Use toggle-truncate-lines; reduce -> cl-reduce
authorBar Magal <barmagal@gmail.com>
Fri, 10 Jul 2015 17:30:30 +0000 (20:30 +0300)
committerBar Magal <barmagal@gmail.com>
Fri, 10 Jul 2015 17:30:30 +0000 (20:30 +0300)
Enabling toggle-truncate-lines in which-key--buffer, to avoid empty
lines when the window is just a bit too narrow.

which-key.el

index a684756c7c0f7e8734d5d69fa96cf7b63ab0ee70..e0f335a4b8d12980cfbbc7f61ad79a13bd35ce76 100644 (file)
@@ -198,6 +198,7 @@ Used when `which-key-popup-type' is frame.")
   "Create buffer for which-key."
   (setq which-key--buffer (get-buffer-create which-key-buffer-name))
   (with-current-buffer which-key--buffer
+    (toggle-truncate-lines 1)
     (setq-local cursor-type nil)
     (setq-local cursor-in-non-selected-windows nil)
     (setq-local mode-line-format nil))
@@ -569,10 +570,10 @@ the maximum number of lines availabel in the target buffer."
             col-key-cns    (car col-split)
             rem-key-cns    (cadr col-split)
             n-col-lines    (min avl-lines (length rem-key-cns))
-            col-key-width  (reduce (lambda (x y)
+            col-key-width  (cl-reduce (lambda (x y)
                                      (max x (length (substring-no-properties (car y)))))
                                    col-key-cns :initial-value 0)
-            col-desc-width (reduce (lambda (x y)
+            col-desc-width (cl-reduce (lambda (x y)
                                      (max x (length (substring-no-properties (cdr y)))))
                                    col-key-cns :initial-value 0)
             col-width      (+ 4 (length (substring-no-properties sep-w-face))